import PageTools from './PageTools'
import UploadExcel from './UploadExcel'
import ImageUpload from './ImageUpload'
import lang from './Lang'
import TagsView from './TagsView'

// Vue.use() => 调用对象里的innstall方法
export default {
  install(Vue) { // 传入Vue对象
    Vue.component('PageTools', PageTools) // 后面是组件
    Vue.component('UploadExcel', UploadExcel) // 注册导入excel组件
    Vue.component('ImageUpload', ImageUpload)
    Vue.component('Lang', lang)
    Vue.component('TagsView', TagsView)
    // 休眠函数
    Vue.prototype.$sleep = function(timer = 200) {
      return new Promise(resolve => {
        setTimeout(() => resolve(), timer)
      })
    }
  }
}
